<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="codeMirror/codemirror.css">
    <link rel="stylesheet" href="codeMirror/monokai.css">
    <link rel="stylesheet" href="codeMirror/dialog.css">
    <style>

    </style>
</head>
<body style="width: 100%;height: 100%;">
<div id="pfodiv" class="ui-widget-content" style="position:absolute;top: 0px;left: 0px;width: 100%;height: 100%;background:#ffffff;overflow: hidden;">
		 <textarea id="code" name="code">
</textarea>	
</div>
</body>
<script src="codeMirror/codemirror.js"></script>
<script src="codeMirror/matchbrackets.js"></script>
<script src="codeMirror/active-line.js"></script>
<script src="codeMirror/sublime.js"></script>
<script src="codeMirror/javascript.js"></script>
<script src="codeMirror/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="../../utils/CommonUtil.js"></script>
<script src="codeMirror/annotatescrollbar.js"></script>
	<script src="codeMirror/matchesonscrollbar.js"></script>
	<script src="codeMirror/match-highlighter.js"></script>
	<script src="codeMirror/jump-to-line.js"></script>
	<script src="codeMirror/dialog.js"></script>
	<script src="codeMirror/searchcursor.js"></script>
	<script src="codeMirror/search.js"></script>

<script>
    window.onload = function() {
		intParams();
    };
    function intParams (){
    	$.ajax({
			url: "compares/getCompPFODatas",
			type:'POST',
			cache:false,
			async:true,
			dataType: "json",
			data: JSON.stringify({}),
			contentType:"application/json",
	        success:function(data){
                initT (data.datData);
			},
			error:function(data){
				initT ("");
			}
		});
    }
    function initT (data){
    	$('#code').text(data);
        let editor = CodeMirror.fromTextArea(document.getElementById("code"), {
            mode: 'text/html', //设置编译器编程语言关联内容，需要引入mode/javascript/javascript.js
            lineNumbers: true, //显示行号
            smartIndent: true, //自动缩进是否开启
            indentUnit: 4, //缩进单位
            theme: 'monokai', //设置主题
            styleActiveLine: true, //设置光标所在行高亮，需要引入addon/selection/active-line.js
            keyMap: 'sublime', // 快捷键，default使用默认快捷键，除此之外包括emacs，sublime，vim快捷键，使用需引入工具,keymap/sublime.js
            extraKeys: {'Ctrl-Q': 'autocomplete'}, //设置快捷键
        });
         editor.setSize('900','550');
    }
</script>
</html>